Problem: $f(x, y, z) = \left( \sin(x), \cos(z), \tan(y) \right)$ What is the divergence of $f$ at $\left( \pi, 0, \dfrac{\pi}{2} \right)$ ?
The formula for divergence in three dimensions is $\text{div}(f) = \dfrac{\partial P}{\partial x} + \dfrac{\partial Q}{\partial y} + \dfrac{\partial R}{\partial z}$, where $P$ is the $x$ -component of $f$, $Q$ is the $y$ -component, and $R$ is the $z$ -component. Let's differentiate! $\begin{aligned} \dfrac{\partial P}{\partial x} &= \dfrac{\partial}{\partial x} \left[ \sin(x) \right] \\ \\ &= \cos(x) \\ \\ \dfrac{\partial Q}{\partial y} &= \dfrac{\partial}{\partial y} \left[ \cos(z) \right] \\ \\ &= 0 \\ \\ \dfrac{\partial R}{\partial z} &= \dfrac{\partial}{\partial z} \left[ -\tan(y) \right] \\ \\ &= 0 \end{aligned}$ Adding the three partial derivatives, $\text{div}(f) = \cos(x)$. The divergence of $f$ at $(\pi, e, 5)$ is $-1$.